package com.andaily.domain.user;

import com.andaily.domain.account.AccountOverviewShowType;
import com.andaily.domain.account.AccountOverviewSortType;
import com.andaily.domain.account.AccountStatisticsType;

import java.io.Serializable;

/**
 * It is a component of <code>UserSetting</code>
 *
 * @author Shengzhao Li
 * @see AccountSetting
 */
public class AccountSetting implements Serializable {

    /**
     * Default pre page size
     */
    public static final int DEFAULT_PRE_PAGE_SIZE = 30;

    private int preAccountPageSize = DEFAULT_PRE_PAGE_SIZE;

    private AccountOverviewShowType accountOverviewShowType = AccountOverviewShowType.ALL;
    private AccountOverviewSortType accountOverviewSortType = AccountOverviewSortType.DEFAULT;

    private AccountStatisticsType accountStatisticsType = AccountStatisticsType.NONE;
    /**
     * Send statistics email to user every month or not.
     */
    private boolean sendMonthStatisticsEmail = false;

    /**
     * Default constructor
     */
    public AccountSetting() {
    }

    public AccountSetting setPreAccountPageSize(int preAccountPageSize) {
        this.preAccountPageSize = preAccountPageSize;
        return this;
    }

    public AccountSetting setAccountOverviewShowType(AccountOverviewShowType accountOverviewShowType) {
        this.accountOverviewShowType = accountOverviewShowType;
        return this;
    }

    public AccountSetting setAccountOverviewSortType(AccountOverviewSortType accountOverviewSortType) {
        this.accountOverviewSortType = accountOverviewSortType;
        return this;
    }

    public AccountSetting setAccountStatisticsType(AccountStatisticsType accountStatisticsType) {
        this.accountStatisticsType = accountStatisticsType;
        return this;
    }

    public AccountSetting setSendMonthStatisticsEmail(boolean sendMonthStatisticsEmail) {
        this.sendMonthStatisticsEmail = sendMonthStatisticsEmail;
        return this;
    }

    public int preAccountPageSize() {
        return preAccountPageSize;
    }

    public AccountOverviewShowType accountOverviewShowType() {
        return accountOverviewShowType;
    }

    public AccountOverviewSortType accountOverviewSortType() {
        return accountOverviewSortType;
    }

    public AccountStatisticsType accountStatisticsType() {
        return accountStatisticsType;
    }

    public boolean sendMonthStatisticsEmail() {
        return sendMonthStatisticsEmail;
    }
}
